<%
'***********************************************************************
'** Copyright (C) 2001 - 2002 Max Yuan All Rights Reserved
'**
'** By using this program, you are agreeing to the terms of the
'** GNU General Public License.
'**
'** This program is free software; you can redistribute it and/or
'** modify it under the terms of the GNU General Public License
'** as published by the Free Software Foundation; either version 2
'** of the License, or any later version.
'**
'** All copyright notices regarding MaxWebPortal must remain intact
'** in the scripts and in the outputted HTML.
'** The "powered by" text/logo with a link back to 
'** http://www.maxwebportal.com in the footer of the pages MUST
'** remain visible when the pages are viewed on the internet or intranet.
'**
'** Support can be obtained from support forums at:
'** http://www.maxwebportal.com
'**
'** Email: maxwebportal@hotmail.com
'** ICQ: 148111300
'***********************************************************************
%><%
CurPageType = "downloads"
CurPageInfoChk = "1"
function CurPageInfo ()
	strOnlineQueryString = Request.QueryString
	PageName = "Downloads"
	PageAction = "Viewing<br>" 
	PageLocation = "dl.asp"
	CurPageInfo = PageAction & " " & "<a href=" & PageLocation & ">" & PageName & "</a>"

end function
%>
<!-- #INCLUDE FILE="config.asp" -->
<!-- #INCLUDE FILE="inc_functions.asp" -->
<!-- #INCLUDE FILE="inc_top.asp" -->
<%
strSql = "select * from DL_categories order by cat_name"
dim rsCategories
set rsCategories = server.CreateObject("adodb.recordset")
rsCategories.Open strSql, my_Conn
%>
<table border="1" width="99%" align="center">
<tr>
<td width="180" valign="top"><!-- #include file=dl_menu.asp --></td>
<td width="100%" valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
         <td align="center" bgcolor="<% =strHeadCellColor %>">
         <b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>">Downloads</font></b>
        </td>
      </tr>
  <tr>
    <td bgcolor="<% =strTableBorderColor %>">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="<%= strForumCellColor %>" width="100%">
      <table border="0" cellpadding=6 cellspacing=0 width="100%">
        <tr>
        <% 
		Do while NOT rsCategories.EOF 
			ColNum = 1 
			Do while ColNum < 3
		%>	
          <td ALIGN=LEFT VALIGN=top WIDTH="50%"><font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>"><b><a href="dl_showsub.asp?cat_id=<%=rsCategories("cat_id")%>&cat=<%= ChkString(rsCategories("cat_name"), "urlpath") %>"><%= ChkString(rsCategories("cat_name"), "display") %></a></b>
				<%
				parent_id = rsCategories("cat_id")

				Response.Write "</font><br>"
				
				subsql = "SELECT * FROM DL_subcategories where cat_ID=" & parent_id & " order by subcat_name"
				     
				set rssubcat = my_Conn.Execute(subsql)
				'count = rssubcat.RecordCount
				'count = 1
				do while not rssubcat.EOF 'and count<=3			
					%>	
			  <font face="<%= strDefaultFontFace %>" size="<%= strFooterFontSize %>" color="<%=strDefaultFontColor%>">
			  <a href="dl_showall.asp?cat_id=<%=rssubcat("subcat_ID")%>&parent_id=<%=rsCategories("cat_id")%>&parent_name=<%= ChkString(rsCategories("cat_name"), "urlpath") %>&sub_name=<%= ChkString(rssubcat("subcat_name"), "urlpath") %>"><%= ChkString(rssubcat("subcat_name"), "display") %>
					<%
					sqlcount = "SELECT count(url) FROM DL where category =" & rsSubcat("subcat_id") & " and show = 1"
					Set RScounts = my_Conn.Execute(sqlcount)

					rcounts = RScounts(0)
					if rcounts <> 0 then
						Response.Write "&nbsp;(" & rcounts & ")"
					end if			
					Response.Write "</a>"
					
					rssubcat.movenext
					if rsSubcat.eof then Response.Write "." else Response.Write ", "
					%>
			  </font>
				<%
					'count = count + 1
				loop
				%>
          </td>
			
				<% 
				if NOT rsCategories.EOF then 
					rsCategories.MoveNext 
				end if 

				ColNum = ColNum + 1 

				if NOT rsCategories.EOF then 
				%>

          <td ALIGN=LEFT VALIGN=top WIDTH="50%"><font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>+1"><b><a href="dl_showsub.asp?cat_id=<%=rsCategories("cat_id")%>&cat=<%= ChkString(rsCategories("cat_name"), "urlpath") %>"><%= ChkString(rsCategories("cat_name"), "display") %></a></b>
					<%
					parent_id = rsCategories("cat_id")
					Response.Write "</font><br>"
					subsql = "SELECT * FROM DL_subcategories where cat_ID=" & parent_id & " order by subcat_name"
     
					set rssubcat = my_Conn.Execute(subsql)
				'count = rssubcat.RecordCount
				'count = 1
				do while not rssubcat.EOF 'and count<=3			
					%>	
			  <font face="<%= strDefaultFontFace %>" size="<%= strFooterFontSize %>">
			  <a href="dl_showall.asp?cat_id=<%=rssubcat("subcat_ID")%>&parent_id=<%=rsCategories("cat_id")%>&parent_name=<%= ChkString(rsCategories("cat_name"), "urlpath") %>&sub_name=<%= ChkString(rssubcat("subcat_name"), "urlpath") %>"><%= ChkString(rssubcat("subcat_name"), "display") %>
					<%
					sqlcount = "SELECT count(url) FROM DL where category =" & rsSubcat("subcat_id") & " and show = 1"
					Set RScounts = my_Conn.Execute(sqlcount)

					rcounts = RScounts(0)
					if rcounts <> 0 then
						Response.Write " (" & rcounts & ")"
					end if
					Response.Write "</a>"

					rssubcat.movenext
					if rsSubcat.eof then Response.Write "." else Response.Write ", "
					%>
			  </font>
				<%
					'count = count + 1
				loop
					%>
          </td>
		<% 
				end if
				ColNum = ColNum + 1 
			Loop
			%>
		</tr>
			<%
			if NOT rsCategories.EOF then  
				rsCategories.MoveNext  
			end if 
		Loop 
		%>
      </table>
    </td>
  </tr>
</table>
    </td>
  </tr>
</table>

</td>
</tr>
</table>
<% rsCategories.close
set rsCategories = nothing%>
<br>
<!-- #INCLUDE FILE="dl_affiliates.asp" -->
<!-- #INCLUDE FILE="inc_footer.asp" -->